Update bootcamp FAQ about "Checking out others' PRs"#1694
Update bootcamp FAQ about "Checking out others' PRs"#1694ezio-melotti wants to merge 4 commits intopython:mainfrom
Conversation
hugovk
left a comment
There was a problem hiding this comment.
And replace the other two git checkout on this page with git switch?
And also on getting-started/pull-request-lifecycle.rst and index.rst?
| .. code-block:: shell | ||
|
|
||
| $ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -' | ||
| $ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -' |
There was a problem hiding this comment.
| $ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -' | |
| git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -' |
There was a problem hiding this comment.
Most command in the page have the $, even though I don't remember if there was a specific reason/convention, so I didn't remove it. We could remove most/all of them in a separate PR.
https://devguide.python.org/documentation/style-guide/#code-examples says to use prompts sparingly to differentiate input/output lines, even though it's talking mainly about Python >>>/.... We could remove most/all of them in a separate PR.
Also note that the shell highlight is for shell scripts, whereas the console highlight for shell sessions with prompts (see https://pygments.org/docs/lexers/#lexers-for-various-shells).
There was a problem hiding this comment.
Yeah, console is useful when you have a prompt and output to show. Otherwise shell for plain commands.
Console:
$ ls | wc -l # good formatting for command + output 👍
158ls | wc -l # bad formatting for command 👎 Shell:
$ ls | wc -l # bad formatting for output 👎
158ls | wc -l # good formatting for command 👍 Co-authored-by: Hugo van Kemenade <[email protected]>
| .. code-block:: shell | ||
|
|
||
| $ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -' | ||
| $ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -' |
There was a problem hiding this comment.
Most command in the page have the $, even though I don't remember if there was a specific reason/convention, so I didn't remove it. We could remove most/all of them in a separate PR.
https://devguide.python.org/documentation/style-guide/#code-examples says to use prompts sparingly to differentiate input/output lines, even though it's talking mainly about Python >>>/.... We could remove most/all of them in a separate PR.
Also note that the shell highlight is for shell scripts, whereas the console highlight for shell sessions with prompts (see https://pygments.org/docs/lexers/#lexers-for-various-shells).
I wanted to pull a PR branch and I was looking up "Checking out others' PRs", and the options were either to install
gh,hub, or creating a Git alias.Since I wanted a less permanent solution, I created this PR to show the commands individually before suggesting adding them as an alias. In addition I replaced
checkoutwith the more modernswitch, and capitalized "Git".Another possible solution is to add the contributor's repo as a remote and fetch their branch from there, but I didn't want to add yet another solution. If people want to add it, we can create another PR.
📚 Documentation preview 📚: https://cpython-devguide--1694.org.readthedocs.build/